/*
 * FileName: LikeTimesDao.java
 *
 */
package com.mrc.ak.showMan.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.mrc.ak.showMan.model.LikeTimes;
import com.mrc.core.base.BaseDao;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Mrc
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2017-1-19 下午1:59:10          Mrc        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Repository
public class LikeTimesDao extends BaseDao<LikeTimes> {

    protected LikeTimesDao() {
        super(LikeTimes.class);
    }

    /**
     * 根据文件夹、文件名 查找
     * @param folder
     * @param file
     * @return
     */
    public LikeTimes findByFolderAndFile(String folder, String file) {
        String hql = " from LikeTimes t where t.folderName=? and t.fileName=?";
        List<LikeTimes> list = super.queryHQL(hql, folder, file);
        return list.size() > 0 ? list.get(0) : null;
    }

}
